package com.glorysoft.hlgdpda.bindingadapter

import android.graphics.Color
import android.graphics.drawable.Drawable
import android.view.View
import android.widget.TextView
import androidx.databinding.BindingAdapter
import com.glorysoft.tonglingxjpda.entity.BatchListEntity

/**
 * FileName: TabIndexGridAdapter
 * Author: XJH
 * Date: 2021/5/13 17:46
 * Description:
 * History:
 */
object EdcDataAdapter {

    @BindingAdapter(value = ["edcSetBg"], requireAll = false)
    @JvmStatic
    fun setEdcTextBg(textView: TextView, item: BatchListEntity.BatchInfoEntity) {
            if (item.EDCFLAG == "Y"){
                if (item.ISEDC == "N"){
                    textView.isEnabled = true
                    textView.setTextColor(Color.BLUE)
                }else{
                    textView.isEnabled = false
                    textView.setTextColor(Color.LTGRAY)
                }
            }else{
                textView.visibility = View.INVISIBLE
            }
    }

}